from neo4j import GraphDatabase

driver = GraphDatabase.driver(
    "bolt://localhost:7687",
    auth=("neo4j", "12345678"),
    encrypted=False,  # 设置是否加密
    max_connection_lifetime=3600,  # 设置连接的最长存活时间
    max_connection_pool_size=10,  # 最大连接数
)

cypher = "CREATE (p:Person {name:$name,age:$age})"
params = {"name": "李四", "age": "30"}
# 创建节点
with driver.session() as session:
    session.run(cypher, params)
driver.close()
